package llama.core;

import java.util.ArrayList;
import java.util.List;

public class ContactList extends ArrayList<Contact> {
	
	private IUser owner;
	
	public ContactList() {
		super();
	}
	
	public void setOwner(IUser owner) {
		this.owner = owner;
	}

	/**
	 * Set all active contacts to this list. 
	 * @param userContactList
	 */
	public void setContacts(List<UserContact> userContactList) {
		clear();
		for (UserContact userContact : userContactList) {
			if (userContact.getContact().isActive()) {
				Contact contact = new Contact(userContact.getContact(), userContact.getTag());
				add(contact);
			}
		}
	}
	
}
